﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Memory
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var configBuilder = new ConfigurationBuilder();
            configBuilder.AddInMemoryCollection(new Dictionary<string, string?>()
            {
                {"name","lyf" },
                {"age","22" },
                {"work:address","dongFeng Road 118" },
                {"work:position","Programmer" },
                {"values:0","1" },
                {"values:1","2" },
            });

            var config = configBuilder.Build();

            ServiceCollection services = new ServiceCollection();
            services.Configure<Person>(config);
            services.AddScoped<ServiceTest>();
            using (var sp =  services.BuildServiceProvider())
            {
                var test = sp.GetRequiredService<ServiceTest>();
                test.show();
            }
            Console.ReadKey();
        }
    }
}